This repository was archived by the owner on Sep 23, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Handle non-compliant referrers endpoint response with custom transport #170
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Meredith Lancaster <malancas@github.com>
codysoyland
reviewed
Jun 18, 2024
|
|
||
| type noncompliantRegistryTransport struct{} | ||
|
|
||
| func (a *noncompliantRegistryTransport) RoundTrip(req *http.Request) (*http.Response, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a comment to explain why this is needed. Also would be good to include a link to a go-containerregistry issue if we are reporting this as a bug there (since this hack can be removed if go-containerregistry can handle the this unexpected header).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have an issue filed yet but can add a link once I file one.
Signed-off-by: Meredith Lancaster <malancas@github.com>
Signed-off-by: Meredith Lancaster <malancas@github.com>
Signed-off-by: Meredith Lancaster <malancas@github.com>
codysoyland
reviewed
Jun 18, 2024
codysoyland
approved these changes
Jun 18, 2024
codysoyland
pushed a commit
that referenced
this pull request
Jun 24, 2024
codysoyland
pushed a commit
that referenced
this pull request
Jul 9, 2024
codysoyland
pushed a commit
that referenced
this pull request
Sep 16, 2024
codysoyland
pushed a commit
that referenced
this pull request
Oct 10, 2024
codysoyland
pushed a commit
that referenced
this pull request
Nov 18, 2024
codysoyland
pushed a commit
that referenced
this pull request
Jan 7, 2025
codysoyland
pushed a commit
that referenced
this pull request
Mar 27, 2025
codysoyland
pushed a commit
that referenced
this pull request
Apr 10, 2025
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Part of https://github.com/github/package-security/issues/1731
Use a custom transport to handle non-compliant 406 responses from APIs when attempting to reach the refferes. endpoint. If an API does not support the referrers API, we generally expect a 404 response, but we have seen a 406 response as well and want to handle that case.